package com.jymj.entity.huji;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jymj.entity.YlEntity;
import com.jymj.enumEntity.*;
import com.jymj.enumEntity.floatpopu.HyzkEnum;
import com.jymj.enumEntity.floatpopu.RyztEnum;
import com.jymj.enumEntity.floatpopu.WhcdEnum;
import com.jymj.enumEntity.floatpopu.ZzmmEnum;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Created by ljj on 2017/4/6.
 */
@Data
public class ZhaiEntity implements Serializable {

    private Integer zhaiid;
    //户籍成员
    private String housecount;
    //社会关系  户主 之妻 之子 之女 之孙等
    private Integer socialrelat;
    private String socialrelatText;
    //就业情况
    private Integer empsituation;
    private String empsituationText;
    //户别
    private Integer huType;
    private String huTypeText;
    //院落编号id
    private String ylbhid;
    //出生年月
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date birthday;
    //备注
    private String text;
    //是否删除
    private boolean isdelete;
    //院落id
    private Integer ylId;
    //院落
    private YlEntity ylEntity;
    private String idCard;
    private Integer sex;
    private String sexText;
    //操作人
    private String noteTaker;
    //信息提供者
    private String noteInfo;
    //信息来源
    private String infoRes;
    //民族
    private Integer nation;
    private String nationText;
    //户口迁移情况
    private String housemove;
    //村名
    private String xzqmc;
    //年龄
    private Integer age;
    //户主
    private Integer fatherid;
    //户主名称
    private String fatherName;
    //yl中心点
    private String center;

    //'电话
    private String phone;
    //'文化程度
    private Integer whcd;
    private String whcdText;
    //'婚姻状况
    private Integer hyzk;
    private String hyzkText;
    //'政治面貌'
    private Integer zzmm;
    private String zzmmText;
    //'是否劳动力'
    private Integer ldl;
    private String ldlText;
    //是否集体经济组织成员
    private Integer zzcy;
    private String zzcyText;
    //'是否人户分离'
    private Integer rhfl;
    private String rhflText;
    //'人员状态'
    private Integer ryzt;
    private String ryztText;
    //'股东'
    private Integer gd;

    private Integer fjhz;//翻建户主

    private String hjdz;//户籍地址

    private String code;//
    private Integer household;



    private String zhen;//
    //无关
    private Integer startAge;
    private Integer endAge;
    private List<Integer> sexList;
    private List<Integer> empList;
    private List<Integer> huTList;


    /*public String getHousecount() {
        if (getSocialrelat() != null && getSocialrelat() == 1) {
            return housecount == null ? null : housecount;
        } else {
            return housecount == null ? null : housecount.replaceAll("([\\u4e00-\\u9fa5]{1})[\\u4e00-\\u9fa5]{1,3}", "$1**");
        }
    }*/

/*    public String getIdCard() {
        return idCard != null ? idCard.replaceAll("(\\d{4})\\d{10}(\\w{4})", "$1*****$2") : null;
    }*/

    public String getSocialrelatText() {
        if (getSocialrelat() == null) {
            return null;
        }
        return SociarateEnum.getName(getSocialrelat());
    }

    public String getEmpsituationText() {
        if (getEmpsituation() == null) {
            return null;
        }
        return EmpsituaEnum.getName(getEmpsituation());
    }

    public String getHuTypeText() {
        if (getHuType() == null) {
            return null;
        }
        return HuTypeEnum.getName(getHuType());
    }

    public String getSexText() {
        if (getSex() == null) {
            return null;
        }
        return SexEnum.getName(getSex());
    }

    public String getNationText() {
        if (getNation() == null) {
            return null;
        }
        return NationEnum.getName(getNation());
    }

    public String getHyzkText() {
        if (getHyzk() == null) {
            return null;
        }
        return HyzkEnum.getName(getHyzk());
    }

    public String getWhcdText() {
        if (getWhcd() == null) {
            return null;
        }
        return WhcdEnum.getName(getWhcd());
    }

    public String getZzmmText() {
        if (getZzmm() == null) {
            return null;
        }
        return ZzmmEnum.getName(getZzmm());
    }

    private String getLdlText() {
        if (getLdl() == null) {
            return null;
        }
        return IsTrueEnum.getName(getLdl());
    }

    private String getRhflText() {
        if (getRhfl() == null) {
            return null;
        }
        return IsTrueEnum.getName(getRhfl());
    }

    private String getRyztText() {
        if (getRyzt() == null) {
            return null;
        }
        return RyztEnum.getName(getRyzt());
    }

    private String zzcyText() {
        if (getZzcy() == null) {
            return null;
        }
        return IsTrueEnum.getName(getZzcy());
    }
    //const tHeader = ['户籍成员', '社会关系', '就业情况','户别', '年龄', '身份证号','生日','民族','户主名称','操作人','信息提供者','信息来源'];
    //const filterVal = ['housecount', 'socialrelatText', 'empsituationText','huTypeText', 'age', 'idCard','birthday','nation','fatherName','noteTaker','noteInfo','infoRes'];
}
